# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libgexiv2
pkgver=0.14.2
pkgrel=1
pkgdesc='GObject-based wrapper around the Exiv2 library'
url='https://wiki.gnome.org/Projects/gexiv2'
arch=(loong64 x86_64)
license=(GPL2)
depends=(exiv2 glib2)
makedepends=(gobject-introspection meson python-gobject vala)
source=("https://gitlab.gnome.org/GNOME/gexiv2/-/archive/gexiv2-$pkgver/gexiv2-gexiv2-$pkgver.tar.bz2")
b2sums=('400e507f88ea3d14420e2dc43ceedf961ab23b91cc5a2f5671c4d876ecfb7437af14ee75b501d2baf5a3eb319afaf81b1c6f699c1c62fa7b8d211603364bf14a')

build() {
  arch-meson gexiv2-gexiv2-$pkgver build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so libexiv2.so)
  provides+=(libgexiv2.so)

  meson install -C build --destdir "$pkgdir"

  rm -rv "$pkgdir/usr/lib/python3.11/site-packages/gi/overrides/__pycache__"
}
